package xiaozhi.Class;

public class Student {
    private int ID;

    private String name;

    private String birDate;

    private boolean gender;

    public Student() {
    }

    public Student(int ID, String name, String birDate, boolean gender) {
        this.ID = ID;
        this.name = name;
        this.birDate = birDate;
        this.gender = gender;
    }



    @Override
    public String toString() {
        if(gender){
            return "Student{" +
                    "ID=" + ID +
                    ", name='" + name + '\'' +
                    ", birDate='" + birDate + '\'' +
                    ", gender=" + '男' +
                    '}';
        }
        else{
            return "Student{" +
                    "ID=" + ID +
                    ", name='" + name + '\'' +
                    ", birDate='" + birDate + '\'' +
                    ", gender=" + '女' +
                    '}';
        }

    }

    public Student(String birDate) {
        this.birDate = birDate;
    }

    public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBirDate() {
        return birDate;
    }

    public void setBirDate(String birDate) {
        this.birDate = birDate;
    }

    public boolean isGender() {
        return gender;
    }

    public void setGender(String gender) {
        if(gender.equals("男")){
            this.gender = true;
        }
        // else{
        //     this.gender=false;
        // }
            //问题编号：9.4
        this.gender=false;
    }
}
